@import '../../../../styles/base.scss';
@import '../../../../styles/style.scss';

$avatarWidth: 70px;

.marginLeft {
  margin-left: $avatarWidth + 10px;
}

.commentItem {
  // 触发BFC
  overflow: hidden;
  margin-bottom: 20px;

  .flex {
    display: flex;
    position: relative;

    .avatarBox {
      width: $avatarWidth;
      height: $avatarWidth;
      margin-right: 10px;
      border-radius: 14px;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: $themeColor1;

      .avatar {
        width: 100%;
        height: 100%;
      }

      .loading {
        width: 60%;
        height: 60%;
      }
    }

    .replyBtn {
      position: absolute;
      top: 3px;
      right: 0;
      height: 28px;
      width: 28px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 16px;
      border-radius: 10px;
      cursor: pointer;
      @extend .hover;
    }

    .contentBox {
      flex: 1;

      .usrInfo {
        height: 34px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        user-select: none;

        .name {
          display: inline-block;
          height: 30px;
          line-height: 30px;
          color: $textColor2;
          @extend .hover;
          padding: 0 6px;
          border-radius: 10px;
          font-size: 18px;
          margin-right: 4px;
          font-weight: 700;
        }
        .name:hover {
          color: $textColor;
        }

        .flag {
          display: inline-block;
          height: 22px;
          line-height: 24px;
          background-color: rgb(97, 147, 187);
          font-size: 14px;
          padding: 0 4px;
          border-radius: 8px;
          color: rgb(231, 231, 231);
        }
        .date {
          margin-left: 10px;
          font-size: 16px;
        }
      }

      .content {
        background-color: $themeColor1;
        padding: 10px 16px;
        border-radius: 12px;
        font-size: 18px;
        word-break: break-all;

        p,
        ul {
          margin: 0;
          padding: 0;
        }
        li {
          margin-left: 20px;
        }
      }
    }
  }

  .replyBox {
    padding: 14px;
    padding-top: 2px;
  }

  .replyHidden {
    display: none;
  }
}

@media screen and (max-width: 1240px) {
  .marginLeft {
    margin-left: 45rem;
  }

  .commentItem {
    margin-bottom: 20rem;

    .flex {
      .avatarBox {
        width: 40rem;
        height: 40rem;
        margin-right: 5rem;
        border-radius: 8rem;
      }

      .replyBtn {
        top: 4rem;
        height: 16rem;
        width: 16rem;
        font-size: 16rem;
        border-radius: 8rem;
      }

      .contentBox {
        .usrInfo {
          height: 24rem;

          .name {
            height: 24rem;
            line-height: 24rem;
            padding: 0 4rem;
            font-size: 16rem;
            margin-right: 4rem;
          }

          .flag {
            height: 20rem;
            line-height: 22rem;
            font-size: 12rem;
            padding: 0 4rem;
            border-radius: 7rem;
          }
          .date {
            margin-left: 10rem;
            font-size: 14rem;
          }
        }

        .content {
          padding: 4rem 10rem;
          border-radius: 8rem;
          font-size: 15rem;

          li {
            margin-left: 20rem;
          }
        }
      }
    }

    .replyBox {
      padding: 4rem;
      padding-top: 0;
    }
  }
}
